package com.health.healthproject.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.health.healthproject.common.Result;
import com.health.healthproject.dto.AnnouncementDTO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface AnnouncementService {

    // 创建公告
    AnnouncementDTO createAnnouncement(AnnouncementDTO announcementDTO, List<MultipartFile> attachments) throws IOException;

    // 更新公告
    AnnouncementDTO updateAnnouncement(AnnouncementDTO announcementDTO, List<MultipartFile> attachments) throws IOException;

    // 获取公告详情
    AnnouncementDTO getAnnouncement(Long id);

    // 分页查询公告列表
    Page<AnnouncementDTO> listAnnouncements(Integer status,String title,Long userId,String startTime,String endTime, Page<AnnouncementDTO> page);

    // 发布公告
    void publishAnnouncement(Long id);

    // 撤回公告
    void recallAnnouncement(Long id);

    // 删除公告
    void deleteAnnouncement(Long id);

    Result<List<AnnouncementDTO>> latest();

}